package com.zhouyu.config;

import com.zhouyu.service.OrderService;
import com.zhouyu.service.UserService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AppConfig {
	/**
	 *
	 * 相当于factory-bean=appConfig
	 * factory-method = myUserService
	 */
	@Bean
	public UserService myUserService(){
		return new UserService();
	}

	/**
	 *
	 * 相当于factory-bean=appConfig
	 * factory-method = myUserService
	 */
	@Bean
	public UserService myUserService(OrderService orderService){
		return new UserService();
	}

	/**
	 *
	 * 相当于class=AppConfig.class
	 * factory-method = staticUserService
	 */
	@Bean
	public static UserService staticUserService(){
		return new UserService();
	}
}
